home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / memsz313.zip / ENGLISH.CMD < prev    next >
OS/2 REXX Batch file  |  1996-01-17  |  3KB  |  149 lines

  1. /* ENGLISH.CMD: Install MEMSIZE in English. */
  2.  
  3. '@Echo Off'
  4. 'CHCP 850'
  5.  
  6. /* Load REXXUTIL */
  7.  
  8. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  9. Call SysLoadFuncs
  10.  
  11.  
  12. /* Initialize */
  13.  
  14. Signal On Failure Name FAILURE
  15. Signal On Halt Name HALT
  16. Signal On Syntax Name SYNTAX
  17.  
  18. Call SysCls
  19. Say 'Installing MEMSIZE...'
  20. Say ''
  21.  
  22.  
  23. /* Verify the existence of the various component files. */
  24.  
  25. Language = 'ENGLISH'
  26.  
  27. Result = SysFileTree( 'MEMSIZE.EXE', 'Files', 'F' )
  28. If Files.0 = 0 Then
  29.   Do
  30.   Say 'ERROR: MEMSIZE.EXE not found!'
  31.   Signal DONE
  32.   End
  33.  
  34. Result = SysFileTree( Language".DLL", 'Files', 'F' )
  35. If Files.0 = 0 Then
  36.   Do
  37.   Say 'ERROR: 'Language'.DLL not found!'
  38.   Signal DONE
  39.   End
  40.  
  41. Result = SysFileTree( Language".HLP", 'Files', 'F' )
  42. If Files.0 = 0 Then
  43.   Do
  44.   Say 'ERROR: 'Language'.HLP not found!'
  45.   Signal DONE
  46.   End
  47.  
  48. /* Ask for the target directory name. */
  49.  
  50. Say 'Please enter the full name of the directory to which'
  51. Say '  you want MEMSIZE installed (default C:\OS2\APPS): '
  52. Parse Pull Directory
  53. If Directory = "" Then Directory = 'C:\OS2\APPS'
  54.  
  55.  
  56. /* Create the target directory if necessary. */
  57.  
  58. Result = SysFileTree( Directory, 'Dirs', 'D' )
  59. If Dirs.0 = 0 Then
  60.   Do
  61.   Result = SysMkDir( Directory )
  62.   if Result == 0 Then
  63.     Do
  64.     End
  65.   Else
  66.     Do
  67.     Say 'ERROR: Unable to create target directory.'
  68.     Signal DONE
  69.     End
  70.   End
  71. Say ''
  72.  
  73.  
  74. /* Ask for the target folder. */
  75.  
  76. Say 'Do you wish to install to the startup folder? (Y/N)'
  77. Pull YesNo
  78. If YesNo = "Y" Then
  79.   Do
  80.   Folder = '<WP_START>'
  81.   Say 'Object will be placed in the startup folder.'
  82.   End
  83. Else
  84.   Do
  85.   Folder = '<WP_DESKTOP>'
  86.   Say 'Object will be placed on the desktop.'
  87.   End
  88. Say ''
  89.  
  90.  
  91. /* Destroy the old object, if present. */
  92.  
  93. Call SysDestroyObject( '<MEMSIZE>' )
  94. Call SysSleep( 5 )
  95.  
  96.  
  97. /* Perform the installation. */
  98.  
  99. Say 'Copying MEMSIZE to ' Directory '...'
  100. Copy MEMSIZE.EXE Directory                  '1>NUL'
  101. Copy Language".DLL" Directory"\MEMSIZE.DLL" '1>NUL'
  102. Copy Language".HLP" Directory"\MEMSIZE.HLP" '1>NUL'
  103. Copy Language".DOC" Directory"\MEMSIZE.DOC" "1>NUL"
  104.  
  105. Result = SysFileTree( "HLP2INF.EXE", 'Files', 'F' )
  106. If Files.0 > 0 Then
  107.    Do
  108.    Result = SysFileTree( Directory"\MEMSIZE.INF", 'Files', 'F' )
  109.    If Files.0 > 0 Then
  110.       Do
  111.       "Erase" Directory"\MEMSIZE.INF"
  112.       End
  113.    "HLP2INF" Directory"\MEMSIZE.HLP"
  114.    End
  115.  
  116. Result = SysFileTree( "SNAPSHOT.EXE", 'Files', 'F' )
  117. If Files.0 > 0 Then
  118.    Do
  119.    Copy "SNAPSHOT.EXE" Directory"\SNAPSHOT.EXE"  '1>NUL'
  120.    End
  121.  
  122. Say 'Creating program object...'
  123. Type = 'WPProgram'
  124. Title = 'System Resources'
  125. Parms = 'OPEN=DEFAULT;MINWIN=DESKTOP;PROGTYPE=PM;EXENAME='Directory'\MEMSIZE.EXE;STARTUPDIR='Directory';OBJECTID=<MEMSIZE>;NOPRINT=YES;'
  126. Result = SysCreateObject( Type, Title, Folder, Parms, 'ReplaceIfExists' )
  127.  
  128. If Result = 1 Then
  129.   Say 'Object created!  Done.'
  130. Else
  131.   Say 'ERROR: Object not created.'
  132.  
  133. Signal DONE
  134.  
  135. FAILURE:
  136. Say 'REXX failure.'
  137. Signal DONE
  138.  
  139. HALT:
  140. Say 'REXX halt.'
  141. Signal DONE
  142.  
  143. SYNTAX:
  144. Say 'REXX syntax error.'
  145. Signal DONE
  146.  
  147. DONE:
  148. Exit
  149.